package us.nchu.tomtiger.rowMapper;

import org.springframework.jdbc.core.RowMapper;
import us.nchu.tomtiger.model.SmsVerifyCode;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by XiongXuan on 2017/12/31.
 */
public class SmsVerifyCodeRowMapper implements RowMapper {
    @Override
    public Object mapRow(ResultSet rs, int i) throws SQLException {
        SmsVerifyCode verifyCode = new SmsVerifyCode();
        verifyCode.setPhoneNumber(rs.getString(2));
		verifyCode.setCode(rs.getString(3));
        verifyCode.setTime(rs.getTimestamp(4));
        return verifyCode;
    }
}
